class CreateLtfls < ActiveRecord::Migration
  def self.up
    #论坛分类
    create_table :ltfls do |t|
      t.string :flmc,:fljs,:flzts,:flwzs,:flzjwz
      t.timestamps
    end
    #论坛用户
    create_table :ltyhs do |t|
      t.integer :jf,:zxzt,:zxsc,:user_id
      t.string :dlip
      t.datetime :dlsj,:lksj
      t.timestamps
    end
    #论坛等级
    create_table :ltdjs do |t|
      t.integer :user_id,:ltfl_id,:ltdjqx_id
      t.timestamps
    end
    #级别权限设置
    create_table :ltdjqxs do |t|
      t.integer :kyf,:sjf
      t.string :jbmc
      t.timestamps
    end
    
    #我的收藏
    create_table :wdscs do |t|
      t.integer :user_id
      t.string :scurl
      t.timestamps
    end

    #站内短信
    create_table :zndxs do |t|
      t.integer :fxrid,:sxrid,:zt
      t.datetime :fssj
      t.string :bt,:nr
      t.timestamps
    end
        
    
    #论坛发帖
    #xtfl:0－》正常；9－》公告；1－》精华
    create_table :ltfts do |t|
      t.string :flmc,:zt,:nr,:ftr,:fj,:user_fl
      t.integer :ltfl_id,:xtfl
      t.timestamps
    end
    #论坛回复
    create_table :lthfs do |t|
      t.string :zt,:nr,:hfr
      t.integer :ltft_id
      t.timestamps
    end
    
    
  end

  def self.down
    drop_table :ltfls
    drop_table :ltyhs
    drop_table :ltdjs
    drop_table :ltdjqxs
    drop_table :wdscs
    drop_table :zndxs
    drop_table :ltfts
    drop_table :lthfs
  end
end
